<?php

namespace common\service;
/**
 * 服务基类.
 * Class BaseService
 * @package common\service
 */
class BaseService
{
    protected static $_error_msg = null;
    protected static $_error_code = null;

    public static function _err($msg = '' ,$code = -1)
    {
        if($msg)
        {
            self::$_error_msg = $msg;
        }
        else
        {
            self::$_error_msg = '操作失败';
        }
        self::$_error_code = $code;
        return false;
    }

    /**
     * 获取对应的错误信息
     * @return null|string
     */
    public static function getLastErrorMsg()
    {
        return self::$_error_msg;
    }

    /**
     * 获取对应的错误码
     * @return null|int
     */
    public static function getLastErrorCode()
    {
        return self::$_error_code;
    }
}